package android.FiltrosJava;

public class LuminosityCorrection extends PointFilter{
	protected int numIterations = 7;
	
	public LuminosityCorrection(int iterations){
		setIterations(iterations);				
	}
	public void setIterations(int iterations){
		numIterations = iterations;
		if (numIterations < 1)
			numIterations = 1;
	}
	public int[] computeFilter(int px, int py, int[] imageData){
		int somme;
		for (int k = 0; k < numIterations; k++){
			somme = (int) ((imageData[0] + imageData[1] + imageData[2] + 2) /3);				
			for ( int y = 0; y < 3; y++ ) {
				imageData[y] = delimitaCor((int) (imageData[y] + ((20 * somme) / 256.0f)));				
			}			
		}
		
		return imageData;
	}
	@Override
	public int[] applyFilter(int[] pixels) {
		// TODO Auto-generated method stub
		return null;
	}
}